The process of Converting a sound involves the following steps:
pascal OSErr SoundConverterOpen(const SoundComponentData *inputFormat,
const SoundComponentData *outputFormat, SoundConverter *sc)
SoundConverterOpen sets up the conversion session and returns a SoundConverter identifier to be passed to all further routines. The inputFormat parameter specifies the format of the sound data to be converted using a SoundComponentData structure. The following fields must be set up to describe the sound correctly:
The outputFormat parameter specifies the output format, and must be passed fields similar to inputFormat. Output fields that are different from input fields will cause a conversion. For example, if the input sound format is 'raw' and the output format is 'MAC3' , the data resulting from the conversion will be compressed with MACE 3:1. This allows any combination of compression, decompression, channel conversion, sample size conversion and sampling rate conversion. A SoundConverter identifier is returned to manage the session, which must be passed to all further routines.
SoundConverterClose terminates the session and frees up all memory and services associated with this session.
pascal OSErr SoundConverterClose(SoundConverter sc)
| Previous | Chapter Contents | Chapter Top | Next |